package com.fanfanwang.ffw.app.adapter;

import java.util.ArrayList;
import java.util.List;

import com.baidu.mapapi.search.core.PoiInfo;
import com.fanfanwang.ffw.app.R;
import com.fanfanwang.ffw.app.bean.RemindTimeBean;
import com.fanfanwang.ffw.app.bean.ServiceBean;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;


public class RouteLineAdapter extends BaseAdapter {

	private List<PoiInfo> beans;
	private Context mContext;
	public RouteLineAdapter(Context mContext,List<PoiInfo> beans) {
		// TODO Auto-generated constructor stub
		this.mContext = mContext;
		this.beans = beans;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return beans.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		final ViewHolder holder;
		if (convertView == null) {
			LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			convertView = inflater.inflate(R.layout.item_for_route_line, null);
			holder = new ViewHolder();
			holder.tv_routename = (TextView) convertView.findViewById(R.id.tv_routename);
			convertView.setTag(holder);
		}else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.tv_routename.setText(beans.get(position).name);
		return convertView;
	}
	class ViewHolder {
		public 	TextView tv_routename;
	}

}
